<cfcomponent output="false">
	
	<!--- --->
	
	<cffunction name="getValue" access="public" output="false" returntype="string">
		<cfargument name="name" required="true" />
		
		<cfset var value = "" />
		
		<cfif structKeyExists(form,arguments.name)>
			<cfset value = form[arguments.name] />
		</cfif>
		
		<cfif len(value) eq 0 and structKeyExists(url,arguments.name)>
			<cfset value = url[arguments.name] />
		</cfif>
		
		<cfreturn value />
		
	</cffunction>
	
	<!--- --->
	
	<cffunction name="setSession" access="public" output="false" returntype="query">
		<!--- for REST api or any other call that doesn't use a legitimate session --->
		<cfargument name="userID" required="true" />
		<!--- pass in userID and populate any request.session.user variables --->
		
		<cfset var local = {} />
		<cfset local.id = arguments.userID />
		<cfif len(arguments.userID) neq 32>
			<cfset local.id = "nouserID" />
		</cfif>
		
		<cfset local.user = $.run.it('craftivityService.getUser',{userID=local.ID}) />
		
		<cfset request.session = {id=""} />
		<cfset request.session.user = {
			id=arguments.userID,
			admin=local.user.admin,
			agreement=local.user.agreement,
			name="#local.user.first_name# #local.user.last_name#",
			event_categories=local.user.event_categories,
			timezone=local.user.timezone,
			dst=local.user.dst
		} />
		
		<cfreturn local.user />
		
	</cffunction>
	
	<!--- --->

</cfcomponent>